<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>迭代数组</title>
</head>

<body>
  <script>
    let letters = [..."Hello world"]
    // console.log(letters.entries());
    console.log(letters.entries().next());
    // “entries()方法返回一个数组的迭代对象,该对象包含数组的键值对(key/value)
    for (let [index, letter] of letters.entries()) {
      console.log(index);
      console.log(letter);
    }
  </script>
</body>

</html>